<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="../js/vue.js"></script>
	</head>
	<body>
		<div id="root">
			<h2>{{n}}</h2>
			<button @click="increment">数值+1</button>
			<h2 v-big="n">数值扩大十倍</h2>
			<h2>input</h2>
		</div>
	</body>
	<script>
		new Vue({
			el:'#root',
			data(){
				return {
					n:0
				}
			},
			methods:{
				increment(){
					this.n++
				}
			},
			directives:{
				big:function(element,binding){
					// console.log(element,binding)
					element.innerText = binding.value * 10
				}
			}
		})
	</script>
</html>